<html>
<head><meta charset="utf-8"><title>building with stable · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html">building with stable</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="164454647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454647">(Apr 29 2019 at 14:01)</a>:</h4>
<p>thread for gh issue</p>



<a name="164454697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454697">(Apr 29 2019 at 14:02)</a>:</h4>
<p>I think I resolved it</p>



<a name="164454702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454702">(Apr 29 2019 at 14:02)</a>:</h4>
<p>nvm, problem solved</p>



<a name="164454749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454749">(Apr 29 2019 at 14:02)</a>:</h4>
<p>but i am curious</p>



<a name="164454762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454762">(Apr 29 2019 at 14:02)</a>:</h4>
<p>whether we should attempt to support both stable and nightly channels?</p>



<a name="164454773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454773">(Apr 29 2019 at 14:02)</a>:</h4>
<p>or maybe that's not worth it. I don't know</p>



<a name="164454820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454820">(Apr 29 2019 at 14:03)</a>:</h4>
<p>the dependence on the absence/presence of trailing commas in json output format seems quite unfortunate. Don't know which entity is to blame there, I guess its us.</p>



<a name="164454827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454827">(Apr 29 2019 at 14:03)</a>:</h4>
<p>I hope that this colon issue is an odd one</p>



<a name="164454835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454835">(Apr 29 2019 at 14:03)</a>:</h4>
<p>But people aren't <em>supposed</em> to rely on <code>{:?}</code> formatting...</p>



<a name="164454874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454874">(Apr 29 2019 at 14:03)</a>:</h4>
<p>Oh, is RA using <code>{:?}</code> as the way to generate the test output there? Maybe <strong>that</strong> is the real bug then.</p>



<a name="164454884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454884">(Apr 29 2019 at 14:03)</a>:</h4>
<p>yeah, I wonder if we should change our testing strategy</p>



<a name="164454933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454933">(Apr 29 2019 at 14:04)</a>:</h4>
<p>we do use <code>{:?}</code> for snapshot testing</p>



<a name="164454934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454934">(Apr 29 2019 at 14:04)</a>:</h4>
<p>I'll maybe see if there's something easy we can fix there.</p>



<a name="164454947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454947">(Apr 29 2019 at 14:04)</a>:</h4>
<p>e.g. use a Display or something</p>



<a name="164454953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164454953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164454953">(Apr 29 2019 at 14:04)</a>:</h4>
<p>(some more stable format)</p>



<a name="164455030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164455030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164455030">(Apr 29 2019 at 14:05)</a>:</h4>
<p>I also wondered that. The main problem with just using <code>Debug</code> is that test-results are less readable: a hand-crafted <code>Display</code> is almost always better than derived debug</p>



<a name="164455122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164455122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164455122">(Apr 29 2019 at 14:06)</a>:</h4>
<p>OTOH, <code>#[derive(Debug)]</code> is so much easier to use, and it guarantess that, if you add a field, you'll need to update the tests (with manual display, you'll need to remember to add the field to Display yourself)</p>



<a name="164455189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164455189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164455189">(Apr 29 2019 at 14:07)</a>:</h4>
<p>I am currently inclined to think that, as this is strictly about tests, it's ok to rely on <code>Debug</code>, and just update the expected results if it ever changes</p>



<a name="164455192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164455192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164455192">(Apr 29 2019 at 14:07)</a>:</h4>
<blockquote>
<p>if you add a field, you'll need to update the tests</p>
</blockquote>
<p>that could also count on the downsides ;)<br>
I would guess usually if you add a field that's relevant for tests, you'll want to write tests for it and so naturally have to add it to the test representation</p>



<a name="164455277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164455277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164455277">(Apr 29 2019 at 14:08)</a>:</h4>
<p>FWIW, for completion, we <strong>do</strong> use custom representation, because the default one is very verbose</p>



<a name="164455325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164455325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164455325">(Apr 29 2019 at 14:08)</a>:</h4>
<p>which tests actually use Debug?</p>



<a name="164455371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164455371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164455371">(Apr 29 2019 at 14:09)</a>:</h4>
<p>almost all of them, except for type inference and completion?</p>



<a name="164642078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164642078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164642078">(May 01 2019 at 17:49)</a>:</h4>
<p>If <a href="https://github.com/rust-lang/rust/pull/60444" target="_blank" title="https://github.com/rust-lang/rust/pull/60444">https://github.com/rust-lang/rust/pull/60444</a> fixes that annoying caching problem, that would be enough motivation for me to swtitch to nightly and fix the tests to not rely on <code>Debug</code> :P</p>



<a name="164646058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164646058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164646058">(May 01 2019 at 18:36)</a>:</h4>
<p>Hm... I'm probably misunderstanding the comments, but this sounds to me like the compiler error is actually correct and we need to change the code to fix the cycle?</p>



<a name="164646088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20with%20stable/near/164646088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20with.20stable.html#164646088">(May 01 2019 at 18:36)</a>:</h4>
<p>I guess we'll see when the PR is merged ;)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>